var mySwiper = new Swiper ('.swiper-container', {
    direction: 'horizontal', // 垂直切换选项
    loop: false, // 循环模式选项

    // 如果需要分页器
    pagination: {
        el: '.swiper-pagination',
        type:"fraction",
    },

    allowTouchMove: false  //停止滑动

});


$('#kaishi').click(function(){
    mySwiper.slideNext();
});  //滑动方式到下一页面


$(".jie").click(function(){
    var input = $(this).prev().find("input:checked");
    if(input.length!== 0){
        mySwiper.slideNext();
    }else{
        alert("请选择")
    }
});

/*$(".shu").click(function(){
    var input = $(this).prev().find("input:checked");
    if(input.length!== 0){
        window.location.href="../html/fanyingjiang.html"
    }else{
        alert("请选择")
    }
});*/

var page = [
    'fanyingjiang.html',
    'tinengjiang.html',
    'wenhuajiang.html',
    'yizhijiang.html'
];




//生成从minNum到maxNum的随机数
function randomNum(minNum,maxNum){
    switch(arguments.length){
        case 1:
            return parseInt(Math.random()*minNum+1,10);
            break;
        case 2:
            return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10);
            break;
        default:
            return 0;
            break;
    }
}


$('.shu').click(function(){
    //获取到本页已经选中的项
    var input = $(this).prev().find('input:checked');

    if(input.length){

        window.location.href = page[randomNum(0,3)]


    }else{
     alert("你还未进行选择，请查看选择项~~~ o(*￣▽￣*)ブ")
     }
});
